<template>
  <div class="search-list-container">
    <van-cell :title="title" value="隐藏" size="large" />
    <div class="tagBox">
      <van-tag
        color="#efefef"
        text-color="tomato"
        v-for="item in prop.dataList"
        :key="item.wordid"
        @click="handleSearchItemClick(item.keyword)"
      >
        {{ item.keyword }}
      </van-tag>
    </div>
  </div>
</template>

<script lang="ts" setup>
const prop = defineProps(['dataList', 'title'])
const emits = defineEmits(['itemClick'])

const handleSearchItemClick = (keyword: string) => {
  emits('itemClick', keyword)
}
</script>

<style lang="scss" scoped>
.tagBox {
  display: flex;
  flex-wrap: wrap;
  padding: 0 10px;
  .van-tag {
    padding: 3px 5px;
    margin: 10px;
  }
}
</style>
